package metier;

/***********************************************************************
 * Module:  VIP.java
 * Author:  p1104123
 * Purpose: Defines the Class VIP
 ***********************************************************************/

import java.util.*;


public class VIP implements Comparable{

   private int numVIP;

   private String nom;

   private String prenom;

   private static int derniernum = 1;

   private String nationalite;

   private int coefAttrait;

   private String compagnon;

   private int accreditation;

    public VIP(String nom, String prenom, String nationalite, int coefAttrait, String compagnon, int accreditation) {
        this.numVIP = derniernum;
        derniernum++;
        this.nom = nom;
        this.prenom = prenom;
        this.nationalite = nationalite;
        this.coefAttrait = coefAttrait;
        this.compagnon = compagnon;
        this.accreditation = accreditation;
    }
    
    public VIP(int numero, String nom, String prenom, String nationalite, int coefAttrait, String compagnon, int accreditation) {
        this.numVIP = numero;
        this.nom = nom;
        this.prenom = prenom;
        this.nationalite = nationalite;
        this.coefAttrait = coefAttrait;
        this.compagnon = compagnon;
        this.accreditation = accreditation;
    }
    
    
    
    public VIP() {
        this.numVIP = 0;
        this.nom = "";
        this.prenom = "";
        this.nationalite = "";
        this.coefAttrait = 0;
        this.compagnon = "";
        this.accreditation = 0;
    }

    public int getNumVIP() {
        return numVIP;
    }

    public void setNumVIP(int numVIP) {
        this.numVIP = numVIP;
    }

    public String getNom() {
        return nom;
    }

    public void setNom(String nom) {
        this.nom = nom;
    }

    public String getPrenom() {
        return prenom;
    }

    public void setPrenom(String prenom) {
        this.prenom = prenom;
    }

    public String getNationalite() {
        return nationalite;
    }

    public void setNationalite(String nationalite) {
        this.nationalite = nationalite;
    }

    public int getCoefAttrait() {
        return coefAttrait;
    }

    public void setCoefAttrait(int coefAttrait) {
        this.coefAttrait = coefAttrait;
    }

    public String getCompagnon() {
        return compagnon;
    }

    public void setCompagnon(String compagnon) {
        this.compagnon = compagnon;
    }

    public int getAccreditation() {
        return accreditation;
    }

    public void setAccreditation(int accreditation) {
        this.accreditation = accreditation;
    }

    public static void setDerniernum(int i) {
        derniernum = i;
    }
    
    public static int getDerniernum() {
        return derniernum;
    }
    
    public static void incrementDerniernum()
    {
        derniernum++;
    }
    
    @Override
    public String toString() {
        return "VIP{" + "numVIP=" + numVIP + ", nom=" + nom + ", prenom=" + prenom + ", nationalite=" + nationalite + ", coefAttrait=" + coefAttrait + ", compagnon=" + compagnon + ", accreditation=" + accreditation + '}';
    }

    @Override
    public int compareTo(Object o) {
        VIP tmp = (VIP) o;
        if (this.numVIP > tmp.getNumVIP()) return 1;
        else if (this.numVIP < tmp.getNumVIP()) return -1;
        else return 0;
    }
    
   

}